package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {
    //根据openid查询用户 看看是这个用户是新用户吗
    @Select("select * from user where openid = #{openid}")
    User selectByOpenid(String openid);

    //插入用户
    void insert(User user);

    @Select("select count(id) from user where  create_time < #{endTime}")
    Integer countByDatetotal( LocalDateTime endTime);
    @Select("select count(id) from user where create_time > #{beginTime} and create_time < #{endTime}")
    Integer countByDatenew(LocalDateTime beginTime, LocalDateTime endTime);
}
